package com.jeesite.modules.codingrule.entity.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.jeesite.modules.codingrule.enums.BarcodeTypeEnum;
import com.jeesite.modules.codingrule.enums.CodingTypeEnum;
import com.jeesite.modules.codingrule.enums.ObjectTypeEnum;
import lombok.Data;

import java.util.Date;

/**
 * 编码规则VO
 *
 * @author 码脑洞
 * @version 2025-04-13
 */
@Data
public class CodingRuleVO {

	private static final long serialVersionUID = 1L;
	@JsonSerialize(using = ToStringSerializer.class)
	private Long autoId;
	private String objectType;
	private String objectTypeName;
	private String barcodeType;
	private String barcodeTypeName;
	private String formCode;
	private String formName;
	private String codingType;
	private String codingTypeName;
	private String codingDesc;
	private String status;
	private String remarks;
	private String createBy;
	private Date updateDate;

	public String getObjectTypeName() {
		if (this.objectType == null) {
			return null;
		}
		return ObjectTypeEnum.getName(this.objectType);
	}

	public String getBarcodeTypeName() {
		if (this.barcodeType == null) {
			return null;
		}
		return BarcodeTypeEnum.getName(this.barcodeType);
	}

	public String getCodingTypeName() {
		if (this.codingType == null) {
			return null;
		}
		return CodingTypeEnum.getName(this.codingType);
	}
}